/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package experiments.Logging;

import org.apache.log4j.Logger;

/**
 *
 * @author o.rybyanskyy
 */
public class Printer {
    static Logger logger = Logger.getLogger("main.printer");
    private String valueToPrint = null;
    
    Printer(String s){
        valueToPrint = s;
        logger.debug("value to print is " + s +".");
    }
    
    public void print(){
        String finalValue = Formatter.format(valueToPrint);
        if (logger.isDebugEnabled()){
            logger.debug("original value formatted.");
        }
        
        System.out.println(finalValue);
        if (logger.isDebugEnabled()){
            logger.info("final value(" + finalValue +") printed to System output");
        }
        
    }
}
